﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
//using GwLib.Common;

namespace GwLib.JqGridMvc
{


    /*
        Equal="eq",
        NotEqual="ne",
        Less="lt",
        LessOrEqual="le",
        Greater="gt",
        GreaterOrEqual="ge",
        BeginsWith="bw",
        DoesNotBeginWith="bn",
        IsIn="in",
        IsNotIn="ni",
        EndsWith="ew",
        DoesNotEndWith="en",
        Contains="cn",
        DoesNotContain="nc"*/

    public class JqGridAjaxSearchFilter : IGridSearchFilter
    {
        public GroupOperator GroupOperator { get; set; }

        public IList<IGridSearchFilterEntry> SearchEntries { get; set; }
    }
    public class JqGridAjaxSearchFilterEntry : IGridSearchFilterEntry
    {
        public string SearchString { get; set; }
        public SearchOperator SearchOperator { get; set; }
        public string SearchField { get; set; }
    }

    public class JqGridAjaxEventArgs : IGridDataParameters
    {
        public bool IsSearchRequest {get;set;}
        public DateTime? RequestTime {get;set;}
        public int RecordsPerPage { get; set; }
        public int PageNumber { get; set; }
        public string SortField { get; set; }
        public bool SortAscending { get; set; }
        public string SecondarySortField { get; set; }
        public bool SecondarySortAscending { get; set; }
        public string SearchString { get; set; }
        public SearchOperator SearchOperator { get; set; }
        public string SearchField { get; set; }
        public string FilterString { get; set; }
        public IList<IGridSearchFilter> Filters { get; set; }
        public int? TotalRecordCount { get; set; }


        /*Use this option to set common search rules. If not set all the available options will be used. All available option are: ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'] The corresponding texts are in language file and mean the following: ['equal','not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'] Note that the elements in sopt array can be mixed in any order.*/
        
        /*
nd	1320263838874
rows	40
page	1
sidx	ISO3166Alpha2Code
sord	asc
searchField	ISO3166Alpha2Code
searchString	US
searchOper	eq
filters
         * 
q
_search
nd
rows
page
sidx
sord
filters
searchField
searchString
searchOper
         * 
         * 
page - the the requested page - default value page, 
rows - the number of rows requested - default value rows, 
sort - the sorting column - default value sidx, 
order - the sort order default value sord, 
search - the search indicator - default value _search, 
nd - the time passed to the request (for IE browsers not to cache the request) - default value nd, 
id - the name of the id when post data in editing modules - default value id, 
oper - the operation parameter - default value oper, 
editoper - the name of operation when the data is posted in edit mode - default value edit, 
addoper - the name of operation when the data is posted in add mode - default value add,
deloper - the name of operation when the data is posted in delete mode - default value del 
totalrows - the name of the total rows to be obtained from server - see rowTotal - default value totalrows 
subgridid - the name passed when we click to load data in subgrid - default value id
         */
    }
}